package com.cenluan.kit;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;

/**
 * IO工具类
 * 
 * @author peak
 * 
 */
public class IOKit {
	/**
	 * 输入流转化为字符串
	 * 
	 * @param in
	 * @return
	 * @throws IOException
	 */
	public static String iptToStr(InputStream is) throws IOException {
		ByteArrayOutputStream baos = new ByteArrayOutputStream();
		int i = -1;
		while ((i = is.read()) != -1) {
			baos.write(i);
		}
		return baos.toString("UTF-8");
	}
}
